<?php 
	session_start();
    require_once('../cfg/config.php');
	if(!isset($_GET['srvid']) || !isset($_GET['usrid'])) {
		exit;
	}
	try {
		$cnx = new PDO('mysql:host='.$PARAM_hote.';port='.$PARAM_port.';dbname='.$PARAM_nom_db, $PARAM_utilisateur, $PARAM_mdp);
	} catch(Exception $e) {
		echo 'Erreur : '.$e->getMessage().'<br />';
		echo 'N° : '.$e->getCode();
	}
	$cnx->exec('INSERT INTO server_user (server_id, user_id) VALUES ('.(int)$_GET['srvid'].', '.(int)$_GET['usrid'].')');
	$id = $cnx->lastInsertId();
	$user = $cnx->query('SELECT * FROM user WHERE id ='.(int)$_GET['usrid']);
	$user->setFetchMode(PDO::FETCH_OBJ);
	$u = $user->fetch();
?>
<tr>
 <td width="25"><img src="img/serv_del.png" style="cursor:pointer;" onclick="javascript:deleteUser(<?php echo $id ?>)" width="16" height="16" /></td>
 <td><?php echo htmlentities($u->usrnom).' '.htmlentities($u->usrpre).' ('.htmlentities($u->usrlog).') '; ?></td> 
</tr>